<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/src/css/layui.css}">
</head>
<body>
<blockquote class="layui-elem-quote list_search">
    <div class="layui-inline">
        <a class="layui-btn layui-btn-normal adminAdd_btn"><i
                class="layui-icon">&#xe608;</i> 添加管理员</a>
    </div>
    <div class="layui-inline">
        <a class="layui-btn layui-btn-danger batchDel"><i
                class="layui-icon">&#xe640;</i>批量删除</a>
    </div>
</blockquote>
<!--管理员Id-->
<input type="hidden" value="18" id="adminId">
<table id="adminList" lay-filter="test"></table>


<script th:src="@{/src/layui.js}"></script>
<script>
    layui.use(['table','jquery','layer','form','laypage','laytpl'],function () {
        var table = layui.table,
            $ = layui.jquery,
            laypage = layui.laypage,
            layer = layui.layer,
            laytpl = layui.laytpl;
        table.render({
            id:'adminList',
            elem:'#adminList',
            cellMinWidth:80,
            url:'/admin/list', //请求加载数据的接口
            page:true,
            limit:10,
            limits:[10,20,30],
            toolbar:true,
            cols:[
                [
                    {type:'checkbox'},
                    {title:'ID',field:'id'},
                    {title:'登录名',field:'username'},
                    {title:'全称',field:'fullname'},
                    {title:'邮箱',field:'email'},
                    {title:'性别',field:'sex',templet:'#sexTml'},
                    {title:'出生日期',field:'birthday'},
                    {title:'地址',field:'address'},
                    {title:'联系方式',field:'phone'},
                    {title:'角色',field:'roleName'},
                    {title:'操作',field:'operate',templet:'#barEdit'}
                ]
            ],
            parseData:function (result) {//result是服务器端响应的数据
                return {
                    code:result.code ==200?0:result.code(),
                    msg:result.message,
                    data:result.data.list,
                    count:result.data.total
                }
            }
        });



    });

</script>

<script type="text/html" id="barEdit">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script type="text/html" id="sexTml">
    {{# if(d.sex==1){ }}
    <span>男</span>
    {{# }else{ }}
    <span>女</span>
    {{# } }}
</script>


<!--<hr>-->
<!--iframe嵌入一个子窗口-->
<!--<iframe src="http://www.baidu.com" width="500px" height="500px" frameborder="0"></iframe>-->











</body>
</html>